package main

import (
	"fmt"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"one_exam/global"
	"one_exam/internal/model/dao"
)

func main() {
	var err error
	dsn := fmt.Sprintf("root:mysql_NSFSGb@tcp(117.27.231.169:3306)/2208a_ks?charset=utf8&parseTime=True")
	global.DB, err = gorm.Open(mysql.Open(dsn))
	if err != nil {
		panic(err)
	}
	fmt.Println("MySQL连接成功")
	global.DB.AutoMigrate(&dao.User{}, &dao.Goods{}, &dao.Price{}, &dao.Would{})

}
